home *** CD-ROM | disk | FTP | other *** search
- Path: hilbert.dnai.com!usenet
- From: Victor Bazarov <vbazarov@imsisoft.com>
- Newsgroups: comp.lang.c++
- Subject: Re: for loop question
- Date: Mon, 05 Feb 1996 12:07:15 -0800
- Organization: IMSI
- Message-ID: <31166373.28DA@imsisoft.com>
- References: <4emqf8$470@opal.southwind.net> <4f1kud$9rk@newsbf02.news.aol.com>
- NNTP-Posting-Host: 204.182.61.84
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0b6a (Win95; I)
-
- recursion@aol.com (Recursion) wrote:
- >
- > The loop is never entered when you set the value equal to 0. You have
- > specifed the loop check value to be performed while equal to 10 by using
- > the ==. The program works when the value is less than 10. If you were to
- > set use
- >
- > int i;
- > for (i=10;i==10;i++) the program would enter the loop only one time and
- > would print out your data.
- >
- > int i;
- > for(i=0;i--10;i++) will never execute because i will never equal 10. ^^^^^^^^^^^^^^^^^^^^ Supposedly this is a type-o and must be
-
- for(i=0;i==10;i++)
-
- Sorry for attention,
- Victor.
-